<template>
  <div>
    <div id="main"></div>
  </div>
</template>
<script>
export default {
  name: "c1",
  data() {
    return {
      mydata: [],
    };
  },
  mounted() {
    this.groupByBuilding();
  },
  methods: {
    groupByBuilding() {
      this.$axios.get("buildings/group").then((res) => {
        if (res.data.code == 200) {
          this.mydata = res.data.data.buildings;
          this.getChar();
        }
      });
    },
    getChar() {
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById("main"));
      var option;
      option = {
  title: {
    text: '物业指标'
  },
  legend: {
    data: ['当前指标', '物业标准']
  },
  radar: {
    // shape: 'circle',
    indicator: [
      { name: '安全性', max: 6500 },
      { name: '舒适性', max: 6500 },
      { name: '公共设施', max: 6500 },
      { name: '智能化', max: 6500 },
      { name: '监控覆盖', max: 6500 },
      { name: '评价', max: 6500 }
    ]
  },
  series: [
    {
      name: 'nowaday vs future',
      type: 'radar',
      data: [
        {
          value: [5000, 4800, 3800, 5000, 4600, 4100],
          name: '当前指标'
        },
        {
          value: [4500, 4500, 4500, 4500, 4500, 4500],
          name: '物业标准'
        }
      ]
    }
  ]
};

option && myChart.setOption(option);

    },
  },
};
</script>
<style scoped>
#main {
  border: 0px solid rgb(255, 0, 0);
  margin-left: 260px;
  margin-top: 50px;
  width: 600px;
  height: 600px;

}
</style>
